﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true"
    CodeBehind="MClass.aspx.cs" Inherits="RN.ERP.Web.Material.Material.MClass" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="Stylesheet" type="text/css" href="../../Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <link href="../../Styles/skins/blue/css/style.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/skins/blue/css/style_msg.css" rel="stylesheet" type="text/css" />
    <link href="../../Scripts/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/jquery.min.js"></script>
    <script type="text/javascript" src="../../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script src="../../Scripts/ligerUI/js/common.js" type="text/javascript"></script>
    <script src="../../Scripts/ligerUI/js/LG.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/ligerUI/js/plugins/ligerGrid.js"></script>
    <script type="text/javascript" src="../../Scripts/ligerUI/js/plugins/ligerLayout.js"></script>
    <script type="text/javascript">
        function OpenAlert(text) {
            $.ligerDialog.warn(text);
            return false;
        }
        $(function () {

            $("#SpecTree").ligerTree({
                nodeWidth: 300,
                url: 'MaterialHandler.ashx?pid=0',
                attribute: ['nodename', 'id'],
                onBeforeExpand: onBeforeExpand,
                isExpand: function (e) {
                    var data = e.data;
                    return data.isexpand;
                },
                onCheck: onCheck,
                checkbox: true,
                single: true,
                slide: true
            });

            manager = $("#SpecTree").ligerGetTreeManager();
            function onBeforeExpand(note) {
                var data = note.data;
                //防止重复加载,使用isloaded 标记
                if ($("#" + note.data.id).data("isloaded")) {
                    return;
                }
                manager.loadData(note.target, 'MaterialHandler.ashx?pid=' + data.id);
                $("#" + note.data.id).data("isloaded", true);
            }
            function onCheck(node, checked) {
                if (checked) {
                    $("#hdnMCCode").val(node.data.id);
                    $("#hdnMCName").val(node.data.text);
                }
                //                $.getJSON('<%=Page.ResolveUrl("~/Person/PersonExpSpecialityInfo.aspx")%>', { "action": "GetSpecTitle", "id": note.data.id, "rand": Math.random() }, function (data) {
                //                    if (data.Result == true) {
                //                        $("#lblTitle").html(data.Message);
                //                    }
                //                });
            }

        })
        function CloseWin() {
            parent.window.CloseWin("1");
            window.parent.$.ligerDialog.close(); ////关闭dialog
            parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
        }

        function returnToParent(result) {
            var oArg = {};
            oArg.Result = result;
            if (result > 0) {
                var code = $("#hdnMCCode").val();
                if (code == '') {
                    OpenAlert("请选择物资分类！");
                    return false;
                }
                //返回数据
                oArg.name = $("#hdnMCName").val();
                oArg.code = $("#hdnMCCode").val();
            }
            //alert(oArg.typeFlags + oArg.certName + oArg.Level + oArg.CLCode + oArg.typeId);
            closeCertChildWin(oArg);
        }
        /*关闭窗口事件*/
        function closeCertChildWin(oArg) {
            parent.window.OnClientCloseCertType(oArg);
            window.parent.$.ligerDialog.close(); ////关闭dialog
            parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
            parent.window.focus(); //返回焦点
        }
    </script>
    <style type="text/css">
        .cell-label
        {
            width: 80px;
        }
        #tabcontainer .l-tab-links
        {
            border-top: 1px solid #D0D0D0;
            border-left: 1px solid #D0D0D0;
            border-right: 1px solid #D0D0D0;
        }
        
        .projectgrid .l-selected .l-grid-row-cell, .projectgrid .l-selected
        {
            background: none;
        }
        
        .access-icon
        {
            background: url(../images/checkbox.gif) 0px 0px;
            height: 13px;
            line-height: 13px;
            width: 13px;
            margin: 4px 20px;
            display: block;
            cursor: pointer;
        }
        .access-icon-selected
        {
            background-position: 0px -13px;
        }
        .l-panel td.l-grid-row-cell-editing
        {
            padding-bottom: 2px;
            padding-top: 2px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="xian">
        <div class="i-con-cn">
            <%--<span id="edit" runat="server"><a style="cursor: pointer;" onclick="AddOrEditKC(2,0);"
                            class="xtbiao">修改</a> </span><span id="del" runat="server"><a style="cursor: pointer;"
                                class="a_del xtbiao">删除</a> </span>--%><span id="Span1" runat="server"><a style="cursor: pointer;"
                                    id="btnCancel"  onclick="returnToParent(0);" class="xtbiao">关闭</a> </span><span id="add" runat="server"><a style="cursor: pointer;"
                                        id="btnSelect" onclick="returnToParent(1);" class="xtbiao">选择</a> </span>
        </div>
    </div>
    <div class="tree">
        <ul id="SpecTree">
        </ul>
    </div>
    <asp:HiddenField ID="hdnMCCode" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hdnMCName" runat="server" ClientIDMode="Static" />
</asp:Content>
